import requests
import json
import random
from time import sleep

global url
url = 'https://open.dairphone.cn/a1s/testvoice2'
global data
data = {
    "sn": "92009100001449",
    "ids": "",
    "color": "r100_100"
}
global headers
headers = {
    'cookies': 'test=6978915ee7dbc5aff1bc34b59e8c0fc5',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362'
}


def public_data():
    for num in range(186, 194):
        Single_ids = f'A{num}'
        data['ids'] = "A213-A215-" + Single_ids
        public_request()


def public_request():
    res = requests.post(url, data=data, headers=headers)
    print(res.json())
    sleep(10)


public_data()
